<template>
  <div>
    <div class="warp_">
      <div class="warp">
        <span></span>
        <span v-show="sho" @click="denglu">登录</span>
        <span v-show="sho" @click="reg()">注册</span>
        <span v-show="show">{{users}}</span>
        <span v-show="show" @click="tuichu">退出></span>
      </div>
      <div class="center1">我的识货</div>
      <div class="center_">
        <div>
          <van-icon name="balance-pay" size="35" />
          <p>待付款</p>
        </div>
        <div>
          <van-icon name="send-gift-o" size="35" />
          <p>待发货</p>
        </div>
        <div>
          <van-icon name="logistics" size="35" />
          <p>待收货</p>
        </div>
        <div>
          <van-icon name="smile-comment-o" size="35" />
          <p>评价</p>
        </div>
      </div>
      <div class="cart" @click="cart">
        <b>我的购物车</b>
        <van-icon class="icon" name="arrow" size="20" />
      </div>
      <div class="center2">识货必备</div>
      <div class="center3">
        <div class="center3_1">
          <div>
            <img src="https://gw.alicdn.com/tfs/TB1Jcbkj4D1gK0jSZFsXXbldVXa-96-96.png" alt />
            <p>每日返现</p>
          </div>
          <div>
            <img src="https://gw.alicdn.com/tfs/TB1zT0hkkT2gK0jSZPcXXcKkpXa-96-96.png" alt />
            <p>领券中心</p>
          </div>
          <div>
            <img src="https://gw.alicdn.com/tfs/TB14QMupYj1gK0jSZFuXXcrHpXa-96-96.png" alt />
            <p>闲置换钱</p>
          </div>
          <div>
            <img src="https://gw.alicdn.com/tfs/TB1csUri13tHKVjSZSgXXX4QFXa-96-96.png" alt />
            <p>客服阿杰</p>
          </div>
        </div>
        <div class="center3_1">
          <div>
            <img src="https://gw.alicdn.com/tps/TB1rhCFPXXXXXa1XVXXXXXXXXXX-96-96.png" alt />
            <p>花呗</p>
          </div>
          <div>
            <img src="https://gw.alicdn.com/tfs/TB1S6oYmQL0gK0jSZFxXXXWHVXa-96-96.png" alt />
            <p>我的快递</p>
          </div>
          <div>
            <img src="https://gw.alicdn.com/tps/TB1RN1QPXXXXXaqXFXXXXXXXXXX-96-96.png" alt />
            <p>我的评价</p>
          </div>
          <div>
            <img src="https://gw.alicdn.com/tfs/TB1q0T8mpOWBuNjy0FiXXXFxVXa-96-96.png" alt />
            <p>主题换肤</p>
          </div>
        </div>
      </div>
    </div>
  </div>
</template>
<script>
import { mapState } from "vuex";
export default {
  data() {
    return {
      sho: true,
      show: false
    };
  },
  methods: {
    cart(){
        this.$router.push({ path: "/cartlist" });
    },
    tuichu() {
      sessionStorage.removeItem("token");
      this.$router.push({ path: "/Home" });
    },
    denglu() {
      this.$router.push({ path: "/login" });
    },
    reg() {
      this.$router.push({ path: "/reg" });
    }
  },
  computed: {
    ...mapState(["users"])
  },
  created() {
    if (sessionStorage.getItem("token")) {
       this.show=true
       this.sho=false
    }
  }
};
</script>
<style lang="scss">
.warp_ {
  width: 100%;
  height: 620px;
  .warp {
    background: #ff782a;
    width: 100%;
    height: 150px;
    display: flex;
    align-items: center;
    overflow: hidden;
    span:nth-of-type(1) {
      width: 60px;
      height: 60px;
      background: black;
      border-radius: 50%;
      margin-right: 20px;
      margin-left: 25px;
      margin-top: 40px;
    }
    span:nth-of-type(2) {
      width: 60px;
      height: 60px;
      color: aliceblue;
      display: flex;
      align-items: center;
      margin-top: 40px;
    }
    span:nth-of-type(3) {
      width: 60px;
      height: 60px;
      color: aliceblue;
      display: flex;
      align-items: center;
      margin-top: 40px;
    }
    span:nth-of-type(4) {
      width: 60px;
      height: 60px;
      color: aliceblue;
      display: flex;
      align-items: center;
      margin-top: 40px;
    }
    span:nth-of-type(5) {
      width: 60px;
      height: 60px;
      color: #000;
      font-size: 11px;
      line-height: 70px;
      margin-left: 85px;
      margin-top: 40px;
    }
  }
  .center1 {
    margin-left: 10px;
    // margin-top: 10px;
    font-size: 18px;
    font-weight: 600;
    border-bottom: 1px dashed #ccc;
  }
  .center_ {
    width: 100%;
    height: 70px;
    margin-top: 5px;
    display: flex;
    justify-content: space-around;
    align-items: center;
    // background: #fff;
    // border-radius: 20px;
    div {
      flex-direction: column;
      display: flex;
      align-items: center;
      color: #ff782a;
      p {
        font-size: 14px;
      }
    }
  }
  .cart {
    width: 100%;
    height: 60px;
    margin-left: 10px;
    border-top: 1px dashed #ccc;
    b {
      font-size: 18px;
      display: block;
      float: left;
      line-height: 60px;
      margin-right: 230px;
    }
    .icon {
      line-height: 60px;
    }
  }
  .center2 {
    margin-left: 10px;
    margin-top: 5px;
    font-size: 18px;
    font-weight: 800;
    border-top: 1px dashed #ccc;
    border-bottom: 1px dashed #ccc;
  }
  .center3 {
    height: 230px;
    width: 350px;
    margin-left: 12px;
    margin-top: 5px;
    .center3_1 {
      display: flex;
      justify-content: space-around;
      align-items: center;
      margin-top: 30px;
      div {
        flex-direction: column;
        display: flex;
        align-items: center;
        width: 56px;
        height: 60px;
        img {
          width: 40px;
          height: 40px;
        }
        p {
          margin-top: 5px;
          font-size: 14px;
        }
      }
    }
  }
}
</style>